home *** CD-ROM | disk | FTP | other *** search
/ Sports Illustrated for Kids - Awesome Athletes! / Sports Illustrated for Kids - Awesome Athletes!.iso / iv.dir / 00318_video utils.ls < prev    next >
Encoding:
Text File  |  1996-04-19  |  16.2 KB  |  354 lines

  1. global gIVEndFrame
  2.  
  3. on PlayClip clipID, mon, pauseIt
  4.   global givState, givCONTROLPANELSPRITE, givBASEMONITORSPRITE, givMAINMONITORSPRITE, gSIEventQ, gSIFlush, givLastRollover, givPlayingQSL, gSIHWnd, gSIShowWindow, gSISystem
  5.   DisableIdleAnim()
  6.   if pauseIt = #play then
  7.     set the activeVideoMode of givState to #play
  8.     if the mode of givState = #play then
  9.       set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode pause button"
  10.       updateStage()
  11.     else
  12.       set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "pause button"
  13.       updateStage()
  14.     end if
  15.     DVIdle()
  16.     MyDVPlay(clipID)
  17.     DVIdle()
  18.   else
  19.     set the activeVideoMode of givState to #pause
  20.     if the mode of givState = #play then
  21.       set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  22.       updateStage()
  23.     else
  24.       set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  25.     end if
  26.     MyDVPlay(clipID)
  27.     DVPause()
  28.   end if
  29.   DVIdle()
  30.   repeat while the mouseDown
  31.     DVIdle()
  32.   end repeat
  33.   gSIShowWindow(mCall, gSIHWnd, 5)
  34.   StartBufferingEvents()
  35.   MessagePut("entering the play clip loop")
  36.   set flashTime to the ticks
  37.   repeat while (the activeVideoMode of givState = #play) or (the activeVideoMode of givState = #pause)
  38.     if the activeVideoMode of givState = #play then
  39.       DVIdle()
  40.     end if
  41.     if (the activeVideoMode of givState = #pause) and not rollOver(givCONTROLPANELSPRITE + 9) and (the ticks > (flashTime + 30)) then
  42.       if the mode of givState = #play then
  43.         if the castNum of sprite (givCONTROLPANELSPRITE + 9) = the number of cast "play mode play button" then
  44.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button" + 1
  45.         else
  46.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  47.         end if
  48.         updateStage()
  49.         set flashTime to the ticks
  50.       else
  51.         if the castNum of sprite (givCONTROLPANELSPRITE + 9) = the number of cast "play button" then
  52.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button" + 1
  53.         else
  54.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  55.         end if
  56.         updateStage()
  57.         set flashTime to the ticks
  58.       end if
  59.     end if
  60.     if not (the mouseDown) then
  61.       set rollsprite to 997
  62.       if the mode of givState = #edit then
  63.         if rollOver(givCONTROLPANELSPRITE + 8) and (count(the questionSelectList of givState) > 0) and (givPlayingQSL = 1) then
  64.           set rollsprite to givCONTROLPANELSPRITE + 8
  65.           set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "next button" + 1
  66.           ResetRollover(rollsprite)
  67.           updateStage()
  68.         end if
  69.         if rollOver(givCONTROLPANELSPRITE + 8) and (count(the editList of givState) > 0) and (givPlayingQSL = 0) then
  70.           set rollsprite to givCONTROLPANELSPRITE + 8
  71.           set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "next button" + 1
  72.           ResetRollover(rollsprite)
  73.           updateStage()
  74.         end if
  75.         if rollOver(givCONTROLPANELSPRITE + 9) and (the activeVideoMode of givState = #play) then
  76.           set rollsprite to givCONTROLPANELSPRITE + 9
  77.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "pause button" + 1
  78.           ResetRollover(rollsprite)
  79.           updateStage()
  80.         end if
  81.         if rollOver(givCONTROLPANELSPRITE + 9) and (the activeVideoMode of givState = #pause) then
  82.           set rollsprite to givCONTROLPANELSPRITE + 9
  83.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button" + 1
  84.           ResetRollover(rollsprite)
  85.           updateStage()
  86.         end if
  87.         if rollOver(givCONTROLPANELSPRITE + 10) then
  88.           set rollsprite to givCONTROLPANELSPRITE + 10
  89.           set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button" + 1
  90.           ResetRollover(rollsprite)
  91.           updateStage()
  92.         end if
  93.         if rollOver(givCONTROLPANELSPRITE + 11) and (count(the questionSelectList of givState) > 0) and (givPlayingQSL = 1) then
  94.           set rollsprite to givCONTROLPANELSPRITE + 11
  95.           set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "previous button" + 1
  96.           ResetRollover(rollsprite)
  97.           updateStage()
  98.         end if
  99.         if rollOver(givCONTROLPANELSPRITE + 11) and (count(the editList of givState) > 0) and (givPlayingQSL = 0) then
  100.           set rollsprite to givCONTROLPANELSPRITE + 11
  101.           set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "previous button" + 1
  102.           ResetRollover(rollsprite)
  103.           updateStage()
  104.         end if
  105.         if rollsprite = 997 then
  106.           ResetRollover(rollsprite)
  107.           updateStage()
  108.         end if
  109.         if the activeVideoMode of givState = #play then
  110.           DVIdle()
  111.         end if
  112.       end if
  113.       if the mode of givState = #play then
  114.         if rollOver(givCONTROLPANELSPRITE + 8) and (count(the questionSelectList of givState) > 0) and (givPlayingQSL = 1) then
  115.           set rollsprite to givCONTROLPANELSPRITE + 8
  116.           set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "play mode next button" + 1
  117.           ResetRollover(rollsprite)
  118.           updateStage()
  119.         end if
  120.         if rollOver(givCONTROLPANELSPRITE + 8) and (count(the editList of givState) > 0) and (givPlayingQSL = 0) and (the activeMonitor of givState = 3) then
  121.           set rollsprite to givCONTROLPANELSPRITE + 8
  122.           set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "play mode next button" + 1
  123.           ResetRollover(rollsprite)
  124.           updateStage()
  125.         end if
  126.         if rollOver(givCONTROLPANELSPRITE + 9) and (the activeVideoMode of givState = #play) then
  127.           set rollsprite to givCONTROLPANELSPRITE + 9
  128.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode pause button" + 1
  129.           ResetRollover(rollsprite)
  130.           updateStage()
  131.         end if
  132.         if rollOver(givCONTROLPANELSPRITE + 9) and (the activeVideoMode of givState = #pause) then
  133.           set rollsprite to givCONTROLPANELSPRITE + 9
  134.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button" + 1
  135.           ResetRollover(rollsprite)
  136.           updateStage()
  137.         end if
  138.         if rollOver(givCONTROLPANELSPRITE + 10) then
  139.           set rollsprite to givCONTROLPANELSPRITE + 10
  140.           set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button" + 1
  141.           ResetRollover(rollsprite)
  142.           updateStage()
  143.         end if
  144.         if rollOver(givCONTROLPANELSPRITE + 11) and (count(the questionSelectList of givState) > 0) and (givPlayingQSL = 1) then
  145.           set rollsprite to givCONTROLPANELSPRITE + 11
  146.           set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "play mode previous button" + 1
  147.           ResetRollover(rollsprite)
  148.           updateStage()
  149.         end if
  150.         if rollOver(givCONTROLPANELSPRITE + 11) and (count(the editList of givState) > 0) and (givPlayingQSL = 0) and (the activeMonitor of givState = 3) then
  151.           set rollsprite to givCONTROLPANELSPRITE + 11
  152.           set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "play mode previous button" + 1
  153.           ResetRollover(rollsprite)
  154.           updateStage()
  155.         end if
  156.         if rollsprite = 997 then
  157.           ResetRollover(rollsprite)
  158.           updateStage()
  159.         end if
  160.         if the activeVideoMode of givState = #play then
  161.           DVIdle()
  162.         end if
  163.       end if
  164.     else
  165.       set ret to EMPTY
  166.       set ev to EMPTY
  167.       if the activeVideoMode of givState = #play then
  168.         DVIdle()
  169.       end if
  170.       set mc to the mouseCast
  171.       if mc = the castNum of sprite (givCONTROLPANELSPRITE + 8) then
  172.         if (count(the questionSelectList of givState) > 0) and (givPlayingQSL = 1) then
  173.           MessagePut("skip to next clip -- playclipnext")
  174.           if the mode of givState = #edit then
  175.             set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "next button"
  176.           else
  177.             set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "play mode next button"
  178.           end if
  179.           updateStage()
  180.           PlayClipNext()
  181.           if the activeVideoMode of givState = #stop then
  182.             EndBufferingEvents()
  183.             if the mode of givState = #play then
  184.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  185.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button"
  186.             else
  187.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  188.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button"
  189.               updateStage()
  190.             end if
  191.             return 1
  192.             exit
  193.           end if
  194.         end if
  195.         if (count(the editList of givState) > 0) and (givPlayingQSL = 0) then
  196.           MessagePut("go to next clip in edit list")
  197.           if the mode of givState = #edit then
  198.             set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "next button"
  199.           else
  200.             set the castNum of sprite (givCONTROLPANELSPRITE + 8) to the number of cast "play mode next button"
  201.           end if
  202.           updateStage()
  203.           PlayEditNext()
  204.           if the activeVideoMode of givState = #stop then
  205.             EndBufferingEvents()
  206.             if the mode of givState = #play then
  207.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  208.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button"
  209.             else
  210.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  211.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button"
  212.               updateStage()
  213.             end if
  214.             return 1
  215.             exit
  216.           end if
  217.         end if
  218.       end if
  219.       if mc = the castNum of sprite (givCONTROLPANELSPRITE + 10) then
  220.         EndBufferingEvents()
  221.         DVStop()
  222.         if the mode of givState = #play then
  223.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  224.           set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button"
  225.         else
  226.           set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  227.           set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button"
  228.           updateStage()
  229.         end if
  230.         set the activeVideoMode of givState to #stop
  231.         return 1
  232.         exit
  233.       end if
  234.       if mc = the castNum of sprite (givCONTROLPANELSPRITE + 9) then
  235.         if the activeVideoMode of givState = #play then
  236.           if the mode of givState = #play then
  237.             set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  238.             updateStage()
  239.           else
  240.             set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  241.             updateStage()
  242.           end if
  243.           DVPause()
  244.           MessagePut("pause clip")
  245.           set the activeVideoMode of givState to #pause
  246.         else
  247.           if the mode of givState = #play then
  248.             set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode pause button"
  249.           else
  250.             set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "pause button"
  251.           end if
  252.           updateStage()
  253.           DVResume()
  254.           MessagePut("resume clip")
  255.           set the activeVideoMode of givState to #play
  256.           DVIdle()
  257.         end if
  258.       end if
  259.       if mc = the castNum of sprite (givCONTROLPANELSPRITE + 11) then
  260.         if (count(the questionSelectList of givState) > 0) and (givPlayingQSL = 1) then
  261.           if the mode of givState = #edit then
  262.             set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "previous button"
  263.           else
  264.             set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "play mode previous button"
  265.           end if
  266.           updateStage()
  267.           MessagePut("skip to previous clip -- playclipprevious")
  268.           PlayClipPrevious()
  269.           if the activeVideoMode of givState = #stop then
  270.             EndBufferingEvents()
  271.             if the mode of givState = #play then
  272.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  273.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button"
  274.             else
  275.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  276.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button"
  277.             end if
  278.             updateStage()
  279.             return 1
  280.             exit
  281.           end if
  282.         end if
  283.         if (count(the editList of givState) > 0) and (givPlayingQSL = 0) then
  284.           MessagePut("go to next clip in edit list")
  285.           if the mode of givState = #edit then
  286.             set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "previous button"
  287.           else
  288.             set the castNum of sprite (givCONTROLPANELSPRITE + 11) to the number of cast "play mode previous button"
  289.           end if
  290.           updateStage()
  291.           PlayEditPrevious()
  292.           if the activeVideoMode of givState = #stop then
  293.             EndBufferingEvents()
  294.             if the mode of givState = #play then
  295.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  296.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button"
  297.             else
  298.               set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  299.               set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button"
  300.               updateStage()
  301.             end if
  302.             return 1
  303.             exit
  304.           end if
  305.         end if
  306.       end if
  307.       repeat while the mouseDown
  308.         DVIdle()
  309.       end repeat
  310.     end if
  311.     if the activeVideoMode of givState = #pause then
  312.       nothing()
  313.     else
  314.       if DVGetPos() >= gIVEndFrame then
  315.         set the activeVideoMode of givState to #stop
  316.         DVStop()
  317.       end if
  318.     end if
  319.     if the activeVideoMode of givState = #play then
  320.       DVIdle()
  321.     end if
  322.   end repeat
  323.   EndBufferingEvents()
  324.   set the activeVideoMode of givState to #stop
  325.   if the mode of givState = #play then
  326.     set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play mode play button"
  327.     set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "play mode stop button"
  328.   else
  329.     set the castNum of sprite (givCONTROLPANELSPRITE + 9) to the number of cast "play button"
  330.     set the castNum of sprite (givCONTROLPANELSPRITE + 10) to the number of cast "stop button"
  331.     updateStage()
  332.   end if
  333.   return 0
  334. end
  335.  
  336. on MyDVPlay clipID
  337.   global givVideoLookupList, givLastClipPlayed, gSISystem, gSIVideoPath, givMAINMONITORSPRITE
  338.   set Frames to getaProp(givVideoLookupList, clipID)
  339.   if voidp(Frames) then
  340.     MessagePut("error: clip not found in video lookup list")
  341.     exit
  342.   end if
  343.   if gSISystem = "MAC" then
  344.     MessagePut("playing clip" && clipID & ": frames" && item 3 of Frames && item 4 of Frames)
  345.     DVPlay(2 * value(item 3 of Frames), 2 * value(item 4 of Frames))
  346.     set gIVEndFrame to 2 * value(item 4 of Frames)
  347.   else
  348.     MessagePut("playing clip" && clipID & ": frames" && item 1 of Frames && item 2 of Frames)
  349.     DVPlay(item 1 of Frames, item 2 of Frames)
  350.     set gIVEndFrame to item 2 of Frames
  351.   end if
  352.   DVShow()
  353. end
  354.